package  org.dong.sys.controller;  
  
import  javax.servlet.http.HttpServletRequest;  
  





import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresUser;
import  org.springframework.stereotype.Controller;  
import  org.springframework.web.bind.annotation.RequestMapping;  
import org.springframework.web.bind.annotation.ResponseBody;
  
@Controller  
@RequestMapping("sys/user") 
public class  UserController {   
    @RequestMapping("")
    @ResponseBody
    @RequiresUser
    public  String getUserInfo(HttpServletRequest request){  
        String currentUser =(String) SecurityUtils.getSubject().getPrincipal();  
        return currentUser;   
    }
}